import $api from '.';

interface member {
  name: string;
  number: number | string;
  [key: string]: any;
}

// 添加
export const addmembership = function (data: member) {
  return $api.post('/membership', data);
};

// 获取
export const getmembershipList = function (data: { $limit: any; $skip: number}) {
  console.log('data', data);
  data.$limit = data.$limit || 20;
  data.$skip = data.$skip || 0;
  return $api.get('/membership', {
    params: data,
  });
};

// 删除
export const delmembership = function (id: number) {
  return $api.delete(`/membership/${id}`);
};

// 修改
export const updatemembership = function (id: number, data: any) {
  return $api.patch(`/membership/${id}`, data);
};

export default {};
